package com.example.blogsystem.model;

import com.example.blogsystem.utils.DateUtil;
import lombok.Data;

import java.util.Date;


@Data
public class Blog {
    private Integer id;
    private String title;
    private String content;
    private Integer userId;
    private Integer deleteFlag;
    private Date createTime;
    private Date updateTime;
    private boolean isLoginUser;

    public Blog(String title, String content, Integer userId) {
        this.title = title;
        this.content = content;
        this.userId = userId;
    }
    public Blog() {

    }

    public String getCreateTime() {
        DateUtil dateUtil = new DateUtil();
        return dateUtil.formatDate(createTime);
    }
}
